USE [OctoNetApps]
GO

/****** Object:  Table [classified].[ClassifiedAttributes]    Script Date: 05/25/2011 06:49:29 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [classified].[ClassifiedAttributes](
	[AttributeID] [bigint] IDENTITY(1,1) NOT NULL,
	[CategoryID] [bigint] NOT NULL,
	[AttributeTitle] [nvarchar](100) NOT NULL,
	[AttributeDescription] [nvarchar](256) NULL,
	[Required] [bit] NOT NULL,
	[SortOrder] [tinyint] NOT NULL,
	[IsCustom] [bit] NOT NULL,
 CONSTRAINT [PK_ClassifiedAttributes] PRIMARY KEY CLUSTERED 
(
	[AttributeID] ASC,
	[CategoryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [classified].[ClassifiedAttributes]  WITH CHECK ADD  CONSTRAINT [FK_ClassifiedAttributes_ClassifiedCategories] FOREIGN KEY([CategoryID])
REFERENCES [classified].[ClassifiedCategories] ([CategoryID])
GO

ALTER TABLE [classified].[ClassifiedAttributes] CHECK CONSTRAINT [FK_ClassifiedAttributes_ClassifiedCategories]
GO

ALTER TABLE [classified].[ClassifiedAttributes] ADD  CONSTRAINT [DF_ClassifiedAttributes_SortOrder]  DEFAULT ((0)) FOR [SortOrder]
GO


